<include file="Public/header"/>
<div class="wrapper m-t">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <a class="h5 font-bold text-info"><i class="glyphicon glyphicon-plus"></i> 【编辑货品】</a>
        </div>
        <div class="ibox-content">
            <form class="form-horizontal form-product" method="post" action="{:U('')}">
                <div class="col-lg-4">
                    <div class="input-group m-b">
                        <span class="input-group-addon bg-info">名称</span>
                        <input type="text" value="{$re.m_name}" name="m_name" class="form-control" required="required">
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon bg-info">货品编码</span>
                        <input type="text" value="{$re.m_number}" name="m_number" class="form-control">
                    </div>
                </div>

                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon bg-info">条形编码</span>
                        <input type="number" value="{$re.bracode}" name="bracode" class="form-control">
                        <span id="sc" class="input-group-addon" style=" cursor: pointer;
                        background:#23C6C8;border-color:#23C6C8;color: #fff;">生成</span>
                    </div>
                </div>

                <div class="clearfix"></div>
                <div class="hr-line-dashed m-t-xxs"></div>


                <div class="col-lg-4">
                    <div class="input-group m-b">
                        <span class="input-group-addon">规格</span>
                        <input type="text" value="{$re.standard}" name="standard" class="form-control">
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon bg-info">颜色</span>
                        <input type="text" value="{$re.color}" name="color" class="form-control">
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon">形态</span>
                        <select name="m_form" class="form-control">
                            <option value="0">选择形态</option>
                            <option value="1">固态</option>
                            <option value="2">液态</option>
                        </select>
                    </div>
                </div>

                <div class="clearfix"></div>
                <div class="hr-line-dashed m-t-xxs"></div>

                <div class="col-lg-2">
                    <div class="input-group m-b">
                        <span class="input-group-addon">进价</span>
                        <input name="bid_price" value="{$re.bid_price}" type="number" class="form-control">
                        <span class="input-group-addon">元</span>
                    </div>
                </div>
                <div class="col-lg-2">
                    <div class="input-group m-b">
                        <span class="input-group-addon">售价</span>
                        <input name="sell_price" value="{$re.sell_price}" type="number" class="form-control">
                        <span class="input-group-addon">元</span>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon bg-info">保质期</span>
                        <input name="expiration_date" value="{$re.expiration_date}" type="number" class="form-control">
                        <span class="input-group-addon">月</span>
                    </div>
                </div>

                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon">单位</span>
                        <select name="unit" class="form-control col-lg-6" >
                            <option value="">选择单位</option>
                            <volist name="darr" id="vi">
                                <option value="{$vi.did}">{$vi.d_name}</option>
                            </volist>

                        </select>
                    </div>
                </div>


                <div class="clearfix"></div>
                <div class="hr-line-dashed m-t-xxs"></div>

                <div class="col-lg-4">
                    <div class="input-group m-b">
                        <span class="input-group-addon">仓储仓位</span>
                        <select name="entrepot" class="form-control">
                            <option>选择仓位</option>
                            <volist name="sping" id="vo">
                                <option value="{$vo.sid}">{$vo.s_name}</option>
                            </volist>

                        </select>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon">供应商</span>
                        <input name="supplier" type="text" value="{$re.supplier}" class="form-control">
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group m-b">
                        <span class="input-group-addon">联系人</span>
                        <input name="linkman" type="text" value="{$re.linkman}" class="form-control">
                    </div>
                </div>

                <div class="clearfix"></div>
                <div class="hr-line-dashed m-t-xxs"></div>

                <div class="col-lg-10">
                    <div class="input-group m-b">
                        <span class="input-group-addon">备注</span>
                        <input name="remark" type="text" value="{$re.remark}" class="form-control">
                    </div>
                </div>

                <div class="clearfix"></div>
                <div class="hr-line-dashed m-t-xxs"></div>

                <input type="hidden" value="{$re.mid}" name="mid"/>
                <div class="form-group">
                    <label class="col-lg-3 control-label"></label>

                    <div class="col-lg-8">
                        <input type="submit" target-form="form-product" class="ajax-post btn btn-primary col-lg-2 col-lg-push-2 m-r" value="确定"/>
                        <input type="button" onclick="javascript:history.back(-1);return false;" class="btn btn-info col-lg-2 col-lg-push-2" value="返回"/>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<script>
    var entrepot='{$re[entrepot]}';
    var unit='{$re[unit]}';
    var m_form='{$re[m_form]}';
    $("[name='entrepot']").val(entrepot);
    $("[name='unit']").val(unit);
    $("[name='m_form']").val(m_form);


    $("#sc").click(function(){
    $("[name='bracode']").val(mathstr());
    });
</script>